package com.pubsys.main.client.componentes.listboxreferencias;

import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;

public class ListBoxTipoReferencia extends Composite{
	
	private ListBox lbxTipo;
	
	public static enum Tipo {
		Inproceedings, Incollections, Chapters, IndividualWork,
		Proceedings,Collections,Books,RFC,Norma
	}
	
	public ListBoxTipoReferencia() {
		lbxTipo = new ListBox();
		lbxTipo.addItem("");
		lbxTipo.addItem("Inproceedings");
		lbxTipo.addItem("Incollections");
		lbxTipo.addItem("Chapters");
		lbxTipo.addItem("Individual work");
		lbxTipo.addItem("Proceedings");
		lbxTipo.addItem("Collections");
		lbxTipo.addItem("Books");
		lbxTipo.addItem("RFC");
		lbxTipo.addItem("Norma");
		//lbxTipo.setVisibleItemCount(1);
		
		// All composites must call initWidget() in their constructors.
		initWidget(lbxTipo);
		
		// Give the overall composite a style name.
		setStyleName("ListBoxTipoReferencia");
	}

	public void addChangeHandler(ChangeHandler handler) {
		lbxTipo.addChangeHandler(handler);
	}

	public int getSelectedIndex() {
		return lbxTipo.getSelectedIndex();		
	}	

}
